package april.example.file_transfer_tcp;

import java.net.ServerSocket;
import java.net.Socket;

public class TransferSocketServer {
	private ServerSocket server;
	private Socket client;

	public void startup() {
		try {
//			server = new ServerSocket(20134);

			while (true) {
//				// File file = new File("d:/test");
//				client = server.accept();
//				System.out.println("client  connect");
//
//				DataInputStream dis = new DataInputStream(
//						new BufferedInputStream(client.getInputStream()));
//
//				DataOutputStream fos = new DataOutputStream(
//						new BufferedOutputStream(
//								new FileOutputStream("d:/test.zip")));
//				int length = 0;
//				byte[] buffer = new byte[1024];
//				while ((length = dis.read(buffer)) != -1) {
//					fos.write(buffer,0,length);
//				}
//				dis.close();
//				fos.close();
//
			}

		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

	}

	public static void main(String[] args) {
		//new TransferSocketServer().startup();
		while(true){}
	}
}
